package com.ecoolex.chinadutyfree.retailer.entity;

import com.ecoolex.framework.common.annotation.Description;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import org.springframework.lang.NonNull;

/**
 *
 *   支付订单记录<br>
 *<br>
 * 数据表： payment_order_record
 *
 */
@Description({"支付订单记录"})
public class PaymentOrderRecord implements Serializable {
    /**
     *
     *   主键    <br>
     *<br>
     * 字段名： payment_order_record.Id
     */
    @Description({"主键", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer id;

    /**
     *
     *   支付订单Id    <br>
     *<br>
     * 字段名： payment_order_record.PaymentOrderId
     */
    @Description({"支付订单Id", "不能为空", "数据长度: 10"})
    @NonNull
    private Integer paymentOrderId;

    /**
     *
     *   操作类型;订单申请;订单检查;订单通知;退款申请;退款检查;退款通知    <br>
     *<br>
     * 字段名： payment_order_record.OperType
     */
    @Description({"操作类型;订单申请;订单检查;订单通知;退款申请;退款检查;退款通知", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer operType;

    /**
     *
     *   交易金额    <br>
     *<br>
     * 字段名： payment_order_record.TransAmount
     */
    @Description({"交易金额", "数据长度: 18"})
    private BigDecimal transAmount;

    /**
     *
     *   交易单号    <br>
     *<br>
     * 字段名： payment_order_record.TransNo
     */
    @Description({"交易单号", "数据长度: 255"})
    private String transNo;

    /**
     *
     *   交易发起时间    <br>
     *<br>
     * 字段名： payment_order_record.TransStartTime
     */
    @Description({"交易发起时间", "数据长度: 26"})
    private Date transStartTime;

    /**
     *
     *   交易时间    <br>
     *<br>
     * 字段名： payment_order_record.TransTime
     */
    @Description({"交易时间", "数据长度: 26"})
    private Date transTime;

    /**
     *
     *   请求参数或者通知的请求参数    <br>
     *<br>
     * 字段名： payment_order_record.Request
     */
    @Description({"请求参数或者通知的请求参数", "数据长度: 2000"})
    private String request;

    /**
     *
     *   返回结果    <br>
     *<br>
     * 字段名： payment_order_record.Response
     */
    @Description({"返回结果", "数据长度: 2000"})
    private String response;

    /**
     *
     *   errorMessage    <br>
     *<br>
     * 字段名： payment_order_record.ErrorMessage
     */
    @Description({"errorMessage", "数据长度: 1000"})
    private String errorMessage;

    /**
     *
     *   结果状态;成功;失败    <br>
     *<br>
     * 字段名： payment_order_record.ResultStatus
     */
    @Description({"结果状态;成功;失败", "不能为空", "数据长度: 5"})
    @NonNull
    private Integer resultStatus;

    public static final Boolean NOT_DELETED = Deleted.NOT_DELETED.value();

    public static final Boolean IS_DELETED = Deleted.IS_DELETED.value();

    /**
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： payment_order_record.Deleted
     */
    @Description({"逻辑删除", "不能为空", "数据长度: 1"})
    @NonNull
    private Boolean deleted;

    /**
     *
     *   创建用户    <br>
     *<br>
     * 字段名： payment_order_record.CreateUser
     */
    @Description({"创建用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String createUser;

    /**
     *
     *   创建时间    <br>
     *<br>
     * 字段名： payment_order_record.CreateTime
     */
    @Description({"创建时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date createTime;

    /**
     *
     *   修改用户    <br>
     *<br>
     * 字段名： payment_order_record.UpdateUser
     */
    @Description({"修改用户", "不能为空", "数据长度: 50"})
    @NonNull
    private String updateUser;

    /**
     *
     *   修改时间    <br>
     *<br>
     * 字段名： payment_order_record.UpdateTime
     */
    @Description({"修改时间", "不能为空", "数据长度: 26"})
    @NonNull
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    /**
     * 获取参数<br><br>
     *
     *   主键    <br>
     *<br>
     * 字段名： payment_order_record.Id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 设置参数<br><br>
     *
     *   主键<br>
     *<br>
     * 字段名： payment_order_record.Id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取参数<br><br>
     *
     *   支付订单Id    <br>
     *<br>
     * 字段名： payment_order_record.PaymentOrderId
     */
    public Integer getPaymentOrderId() {
        return paymentOrderId;
    }

    /**
     * 设置参数<br><br>
     *
     *   支付订单Id<br>
     *<br>
     * 字段名： payment_order_record.PaymentOrderId
     */
    public void setPaymentOrderId(Integer paymentOrderId) {
        this.paymentOrderId = paymentOrderId;
    }

    /**
     * 获取参数<br><br>
     *
     *   操作类型;订单申请;订单检查;订单通知;退款申请;退款检查;退款通知    <br>
     *<br>
     * 字段名： payment_order_record.OperType
     */
    public Integer getOperType() {
        return operType;
    }

    /**
     * 设置参数<br><br>
     *
     *   操作类型;订单申请;订单检查;订单通知;退款申请;退款检查;退款通知<br>
     *<br>
     * 字段名： payment_order_record.OperType
     */
    public void setOperType(Integer operType) {
        this.operType = operType;
    }

    /**
     * 获取参数<br><br>
     *
     *   交易金额    <br>
     *<br>
     * 字段名： payment_order_record.TransAmount
     */
    public BigDecimal getTransAmount() {
        return transAmount;
    }

    /**
     * 设置参数<br><br>
     *
     *   交易金额<br>
     *<br>
     * 字段名： payment_order_record.TransAmount
     */
    public void setTransAmount(BigDecimal transAmount) {
        this.transAmount = transAmount;
    }

    /**
     * 获取参数<br><br>
     *
     *   交易单号    <br>
     *<br>
     * 字段名： payment_order_record.TransNo
     */
    public String getTransNo() {
        return transNo;
    }

    /**
     * 设置参数<br><br>
     *
     *   交易单号<br>
     *<br>
     * 字段名： payment_order_record.TransNo
     */
    public void setTransNo(String transNo) {
        this.transNo = transNo == null ? null : transNo.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   交易发起时间    <br>
     *<br>
     * 字段名： payment_order_record.TransStartTime
     */
    public Date getTransStartTime() {
        return transStartTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   交易发起时间<br>
     *<br>
     * 字段名： payment_order_record.TransStartTime
     */
    public void setTransStartTime(Date transStartTime) {
        this.transStartTime = transStartTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   交易时间    <br>
     *<br>
     * 字段名： payment_order_record.TransTime
     */
    public Date getTransTime() {
        return transTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   交易时间<br>
     *<br>
     * 字段名： payment_order_record.TransTime
     */
    public void setTransTime(Date transTime) {
        this.transTime = transTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   请求参数或者通知的请求参数    <br>
     *<br>
     * 字段名： payment_order_record.Request
     */
    public String getRequest() {
        return request;
    }

    /**
     * 设置参数<br><br>
     *
     *   请求参数或者通知的请求参数<br>
     *<br>
     * 字段名： payment_order_record.Request
     */
    public void setRequest(String request) {
        this.request = request == null ? null : request.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   返回结果    <br>
     *<br>
     * 字段名： payment_order_record.Response
     */
    public String getResponse() {
        return response;
    }

    /**
     * 设置参数<br><br>
     *
     *   返回结果<br>
     *<br>
     * 字段名： payment_order_record.Response
     */
    public void setResponse(String response) {
        this.response = response == null ? null : response.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   errorMessage    <br>
     *<br>
     * 字段名： payment_order_record.ErrorMessage
     */
    public String getErrorMessage() {
        return errorMessage;
    }

    /**
     * 设置参数<br><br>
     *
     *   errorMessage<br>
     *<br>
     * 字段名： payment_order_record.ErrorMessage
     */
    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage == null ? null : errorMessage.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   结果状态;成功;失败    <br>
     *<br>
     * 字段名： payment_order_record.ResultStatus
     */
    public Integer getResultStatus() {
        return resultStatus;
    }

    /**
     * 设置参数<br><br>
     *
     *   结果状态;成功;失败<br>
     *<br>
     * 字段名： payment_order_record.ResultStatus
     */
    public void setResultStatus(Integer resultStatus) {
        this.resultStatus = resultStatus;
    }

    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * 获取参数<br><br>
     *
     *   逻辑删除    <br>
     *<br>
     * 字段名： payment_order_record.Deleted
     */
    public Boolean getDeleted() {
        return deleted;
    }

    /**
     * 设置参数<br><br>
     *
     *   逻辑删除<br>
     *<br>
     * 字段名： payment_order_record.Deleted
     */
    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    /**
     * 获取参数<br><br>
     *
     *   创建用户    <br>
     *<br>
     * 字段名： payment_order_record.CreateUser
     */
    public String getCreateUser() {
        return createUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建用户<br>
     *<br>
     * 字段名： payment_order_record.CreateUser
     */
    public void setCreateUser(String createUser) {
        this.createUser = createUser == null ? null : createUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   创建时间    <br>
     *<br>
     * 字段名： payment_order_record.CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   创建时间<br>
     *<br>
     * 字段名： payment_order_record.CreateTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 获取参数<br><br>
     *
     *   修改用户    <br>
     *<br>
     * 字段名： payment_order_record.UpdateUser
     */
    public String getUpdateUser() {
        return updateUser;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改用户<br>
     *<br>
     * 字段名： payment_order_record.UpdateUser
     */
    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser == null ? null : updateUser.trim();
    }

    /**
     * 获取参数<br><br>
     *
     *   修改时间    <br>
     *<br>
     * 字段名： payment_order_record.UpdateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 设置参数<br><br>
     *
     *   修改时间<br>
     *<br>
     * 字段名： payment_order_record.UpdateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public enum Deleted {
        NOT_DELETED(new Boolean("false"), "未删除"),
        IS_DELETED(new Boolean("true"), "已删除");

        private final Boolean value;

        private final String name;

        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        public Boolean getValue() {
            return this.value;
        }

        public Boolean value() {
            return this.value;
        }

        public String getName() {
            return this.name;
        }
    }

    public enum Column {
        id("Id", "id", "INTEGER", false),
        paymentOrderId("PaymentOrderId", "paymentOrderId", "INTEGER", false),
        operType("OperType", "operType", "INTEGER", false),
        transAmount("TransAmount", "transAmount", "DECIMAL", false),
        transNo("TransNo", "transNo", "VARCHAR", false),
        transStartTime("TransStartTime", "transStartTime", "TIMESTAMP", false),
        transTime("TransTime", "transTime", "TIMESTAMP", false),
        request("Request", "request", "VARCHAR", false),
        response("Response", "response", "VARCHAR", false),
        errorMessage("ErrorMessage", "errorMessage", "VARCHAR", false),
        resultStatus("ResultStatus", "resultStatus", "INTEGER", false),
        deleted("Deleted", "deleted", "BIT", false),
        createUser("CreateUser", "createUser", "VARCHAR", true),
        createTime("CreateTime", "createTime", "TIMESTAMP", false),
        updateUser("UpdateUser", "updateUser", "VARCHAR", false),
        updateTime("UpdateTime", "updateTime", "TIMESTAMP", false);

        private static final String BEGINNING_DELIMITER = "`";

        private static final String ENDING_DELIMITER = "`";

        private final String column;

        private final boolean isColumnNameDelimited;

        private final String javaProperty;

        private final String jdbcType;

        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}